package 约定编程;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author zyl
 * @Description
 * @since 2024/1/24 14:46
 */
public class Invocation {
    private Object params;
    private Method method ;
    private Object[] target ;

    public Invocation(Object params, Method method, Object[] target) {
        this.params = params;
        this.method = method;
        this.target = target;
    }
    //反射方法
    public Object proceed() throws InvocationTargetException,IllegalAccessException {
        return method.invoke(params,target);
    }
}
